﻿@using FwProject.Distribution.Dto
@using X.PagedList
@using FwProject.Authorization
@model IPagedList<NotReceivableDto>
@{
    ViewBag.Title = "未收款客户一览表";
}
@section styles{
    <link href="~/Theme/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Theme/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <style type="text/css">
        .input-group[class*=col-] {
            padding: 0 15px;
        }
    </style>
}
<div class="row wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>@ViewBag.Title</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="buttons.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li>
                            <a href="javascript:Print()">打印</a>
                        </li>
                        <li>
                            <a href="javascript:Export()">导出</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="ibox-content">
                <div class="row m-b-sm m-t-sm">
                    <form class="form-horizontal" asp-controller="FinanceReport" asp-action="NotReceivable" data-ajax="true" data-ajax-update="#data_list" data-ajax-method="Get" data-ajax-mode="replace">
                        <input type="hidden" id="size" name="size" value="0" />
                        <div class="col-lg-2 col-md-3">
                            <label class="control-label col-lg-4 col-md-4">餐厅：</label>
                            <div class="input-group">
                                <input type="text" name="RestaurantName" id="RestaurantName" placeholder="请输入餐厅名称" class="input-sm form-control" autocomplete="off">
                            </div>
                        </div>
                        <div class="col-lg-1 col-md-1">
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary"> 查询</button>
                            </span>
                        </div>
                    </form>
                </div>
                <div id="data_list">
                    @{Html.RenderPartial("NotReceivablePartial", Model);}
                </div>
            </div>
        </div>
    </div>
</div>

@section scripts{
    <script src="~/Theme/js/content.min.js?v=1.0.0"></script>
    <script src="~/Theme/js/plugins/iCheck/icheck.min.js"></script>
    <script src="~/Theme/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="~/js/PrintUtil.js"></script>
    <script type="text/javascript">
        function Print() {
            printGirdObj({
                containerId: 'table_print',//包含表格容器のID
                title: '未收款客户一览表',
                showRowNum: false,  //表格中rownumbers: true时为true
                showOrder: false,//是否显示序号，rownumbers: true时有效，默认false
                printInit: { //打印初始化设置参数
                    portrait: false //true纵向,false横向
                }
            });
        }

        function Export() { 
            var RestaurantName = $('#RestaurantName').val();
            window.location.href = "/FinanceReport/ExportNotReceivable?RestaurantName=" + RestaurantName;
        }

        $(document).ready(function () {

        });

        function DeletAjaxCallback(data, successInfo) {
            CommonAjaxCallback(data, function () {
                window.location.reload();
            }, successInfo);
        }

        $("#data_list").on("change", "#pageSize", function () {
            layer.load();
            var size = $("option:selected", this).val();
            var pageurl = $("#pageurl").val();
            $("#data_list").load("/FinanceReport/NotReceivable?size=" + size + "&r=" + Math.random() + pageurl, function () {
                layer.closeAll();
                $("#size").val($("option:selected", this).val());
            });
        });
    </script>
}
